function [L1,L2]=esti_line(lines,line_id)
    % Arguments:
    % line_struct : these specified line struct
    % choose : these specified chosen index
    L1=[];
    L2=[];
    for i=1:length(line_id)
        line1=lines.box{line_id(i,1)}(find(lines.idx{line_id(i,1)}==line_id(i,2)),:);
        line2=lines.box{line_id(i,1)}(find(lines.idx{line_id(i,1)}==line_id(i,3)),:);
        L1=[L1,main_esti([line1,ones(length(line1),1)])];
        L2=[L2,main_esti([line2,ones(length(line2),1)])];
    end
end

function l=main_esti(line)
    % Arguments:
    % line : each column is a point coordinate [xi,yi,zi]^T along the line
    % Output:
    % l : output line homogenious coordinate [l1,l2,l3]
    [~,~,D]=svd(line);
    l=D(:,end);
    x=[min(line(:,1)):0.1:max(line(:,1))];
    y=-l(1)/l(2)*x-l(3)/l(2);
    plot(x,y,'bo','LineWidth',2);
    hold on;
end